package cn.thoughtworks.school.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;


@FeignClient(name = "${feign.programCenter.name}",
  url = "${feign.programCenter.url}")
@Service
public interface CourseCenterFeign {

  @PutMapping("/api/users/{userId}/roles")
  ResponseEntity updateUserRole(@PathVariable("userId") Long userId, @RequestBody Map userRole);
}
